package com.example.yuejian.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.example.yuejian.Adapter.MyPostAdapter;
import com.example.yuejian.Bean.Post;
import com.example.yuejian.R;
import com.example.yuejian.listener.ClubListener;
import com.example.yuejian.model.PostModel;

import java.util.List;


public class MyPost extends AppCompatActivity implements ClubListener<Post> {
    RecyclerView recyclerView_post;
    MyTitle myTitle;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_post);
        recyclerView_post = (RecyclerView)findViewById(R.id.recyclerView_post);
        recyclerView_post.setLayoutManager(new LinearLayoutManager(MyPost.this));
        myTitle = (MyTitle)findViewById(R.id.tt);
        myTitle.setTitle("我的发帖");
        PostModel clubModel = new PostModel();
        clubModel.myClubData(this,1,1,1);



    }

    @Override
    public void onResponse(Post post) {
        List<Post.PostlistBean> clublistBeen = post.getPostlist();
        MyPostAdapter adapter = new MyPostAdapter(MyPost.this,clublistBeen);
        recyclerView_post.setAdapter(adapter);
    }

    @Override
    public void onFail(String msg) {

    }
}
